<template>
  <div>
    <el-col>
      <p class="table-show-title">基础信息</p>
      <el-col :span="14">
        <el-col
          v-for="item in dataModel.detailInfo"
          :key="item.name"
          :span="12"
          class="text"
        >
          <span v-if="!item.isHiddan" class="label">{{ item.label }}:</span>
          <span v-if="!item.isHiddan" class="value">{{ item.value }}</span>
        </el-col>
      </el-col>
      <el-col :span="10">
        <viewer
          :images="[dataModel.drawPath]"
          @inited="inited"
          class="viewer"
          ref="viewer"
        >
          <template slot-scope="scope">
            <img
              style="width: 420px; margin: 15px 0 0 0"
              v-for="src in scope.images"
              :src="src"
              :key="src"
            />
          </template>
        </viewer>
      </el-col>
      <span></span>
    </el-col>
    <el-col v-if="dataModel.broadInfo">
      <p class="table-show-title">扩展信息</p>
      <el-col :span="24">
        <el-col
          v-for="item in dataModel.broadInfo"
          :key="item.name"
          :span="item.span || 12"
          class="text"
        >
          <span class="label">{{ item.label }}:</span>
          <span class="value">{{ item.value }}</span>
        </el-col>
      </el-col>

      <span></span>
    </el-col>
    <el-col>
      <p class="table-show-title">创建信息</p>
      <el-col :span="24">
        <el-col
          v-for="item in dataModel.createInfo"
          :key="item.name"
          :span="item.span || 13"
          v-if="item.value"
          class="text"
        >
          <span class="label">{{ item.label }}:</span>
          <span class="value">{{ item.value }}</span>
        </el-col>
      </el-col>
    </el-col>
  </div>
</template>
<script>
import "viewerjs/dist/viewer.css";
import Viewer from "v-viewer/src/component.vue";

export default {
  props: ["dataModel"],
  components: { Viewer },
  data() {
    return {};
  },
};
</script>
<style lang="scss">
.table-show-title {
  padding: 0 0 10px 0;
  border-bottom: 1px solid #e9e9e9;
}
.text {
  margin: 20px 0;
  color: #999;
}
</style>